package com.meng.jingtao.coupon.controller;

import java.util.Scanner;

public class Test {
    public static void main(String [] args){
        System.out.println("请随便输入一个数");
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        System.out.println("请再输入一个数");
        int a2 = scanner.nextInt();
        System.out.println("请输入它们之和");
        while (true){
            int sum = scanner.nextInt();
            if (sum == a+a2) {
                System.out.println("计算正确");
                break;

            }else {
                System.out.println("计算错误,请重新输入");
            }

        }


    }
}
